package Guess;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.Scanner;


public class File_read {
    public static void File_read() throws FileNotFoundException {
        String fileName = "d:\\result.txt";

        try (Scanner sc = new Scanner(new FileReader(fileName))) {
            while (sc.hasNextLine()) {  //按行读取字符串
                String line = sc.nextLine();
                System.out.println(line);
            }
        }
    }


}
